The present invention relates generally to database maintenance and more particularly to a system and method for efficiently maintaining a relational database in a processing system.
With the popularity and convenience of network computer systems, data sharing among users through databases has become common in many business environments. Providing central access to information via databases requires careful consideration of database maintenance and management. Further, it is important to provide maintenance to the database while minimizing the affect on the overall performance of the system. Typically in such a system, there are a plurality of clients which have connections to a pool of threads. Each of the threads in the pool of threads is connected to the relational database. Typically when a connection is made from a client, the connection cannot be broken until after a particular activity/request is completed. Accordingly, a particular pool thread that is connected to the relational database may hold resources that block some of the maintenance activities from completing. For example, a data definition request is one type of maintenance activity that may modify the relational database that could be blocked from completing.
One way to perform maintenance activities is to get rid of all of the connections from the client to the resources. The problem with this solution is that it affects the overall performance of the system, because of the cost of terminating the connections as well as the cost of re-establishing the connections after the maintenance activity has completed. Accordingly, what is needed is a system and method for maintaining a relational database while minimizing the impact on the overall performance of the processing system. The system should be easy to implement and be cost effective, and should not require significant modification of existing systems. The present invention addresses such a need.
A method and system for efficiently providing maintenance activity on a relational database that is utilized within a processing system is disclosed. The relational database includes a pool of threads and a plurality of resources. The pool of threads receive requests from a plurality of clients and control the plurality of resources. The method and system comprise determining that a maintenance activity is required and providing a first command that initiates a first process which terminates all threads in the pool of threads if the maintenance activity is required. The method and system further include providing a second command which initiates a second process after the maintenance activity has completed which causes the threads to be created and initiates the processing of requests.
A system and method in accordance with the present invention based upon the determination that a maintenance activity is required causes the pool threads within a relational database to terminate and thus free up resources but also allows the connections from the clients to persist. Once the relational database resources are freed, the maintenance activity is performed, and thereafter distributed relational database processing is resumed.